Skip to content

3.3.0 part B: 401/403 help, failed downloads throw, NuGet metadata, icon, XML docs - #98

Merged
tomasr78 merged 2 commits into
mainfrom
release-3.3.0-part-b
Nov 12, 2026
Merged

tomasr78 merged 2 commits into
mainfrom
release-3.3.0-part-b

Conversation

@tomasr78

Copy link
Copy Markdown
Contributor

The rest of 3.3.0 after #96 (token lookup) and #97 (save fixes).

1. 401 and 403 say what to do. Every ConvertApiException with status 401 or 403 (convert, upload, user, download) now ends with:

The exception type, StatusCode and Response are unchanged, and other statuses keep their message. No trial terms are in the messages.

2. A failed download throws. SaveFileAsync, SaveFilesAsync and FileStreamAsync threw nothing on a 404 or 403: the error page was returned, or saved over the output file. They now throw ConvertApiException with the status and body, and no file is written.

3. NuGet metadata (ConvertApi/ConvertApi.csproj):

  • Tags: add word-to-pdf, excel-to-pdf, pdf-to-word, pdf-to-docx, pdf-to-image, pdf-to-text, html-to-docx, word, excel, powerpoint, html, image and a bare to, with a comment saying why (nuget.org matches "to" only against IDs and tags, so without it the package never shows for "docx to pdf"). Drop the misspelled prdf-extract and pdf2extract.
  • Description: plain ASCII, names C#, .NET, Word, Excel, PowerPoint, HTML, PDF and REST, ends with the free trial.
  • PackageProjectUrl: https://www.convertapi.com/integrations/libraries/csharp?utm_source=nuget&utm_medium=referral&utm_campaign=dotnet-sdk&utm_content=project-url
  • PackageIcon: the ConvertAPI logo (the site's own favicon, scaled to 128x128), embedded. Replaces PackageIconUrl, so NU5048 is gone.

4. XML docs. GenerateDocumentationFile is on, and ConvertApi.xml ships in the package. There are summaries on ConvertAsync, the ConvertApiFileParam constructors, the save and download helpers (with the exceptions they throw) and ConvertApiException (what 401 and 403 mean). The constructors were documented in #96. CS1591 is off, so undocumented members don't add warnings.

5. RELEASING.md:

  • a release owner TODO (still to be decided; publish.yml only accepts tomasr78 today);
  • a pre-release checklist: move [Unreleased], preview the packed README, bump pinned versions, check the convertapi.com C# quick start;
  • a release notes template.

CHANGELOG [Unreleased] and the README "Handle errors" section are updated.

Checked

  • CI steps run locally:
    • Restore and Release build: the same 3 example warnings as main, no new ones.
    • Tests with TreatNoTestsAsError: 32 of 32 pass, 9 of them new in ErrorTests:
      • 401 and 403 messages for convert, upload and user;
      • the Response body is kept;
      • a 500 message is unchanged;
      • a 404 download writes no file and leaves an existing one alone;
      • a 403 stream download throws;
      • a 200 download still saves.
    • Pack: no NU5048.
  • The .nupkg contains README.md, icon.png (128x128) and lib/netstandard2.0/ConvertApi.xml (97 members). The nuspec has the new tags (ending in to), description and project URL.
  • Staging (https://stag-v2.convertapi.com):
    • docx to pdf saves the 146,734-byte PDF;
    • after DeleteFilesAsync (2 files deleted), SaveFileAsync throws ConvertApiException 404 and writes no file;
    • a bad token gets "Conversion from docx to pdf error. Unauthorized. The API token is missing or invalid. Find or get your token at ...".
  • The 403 message was checked only in unit tests: staging has no account without conversions left.

🤖 Generated with Claude Code

…d icon, XML docs, release checklist

- ConvertApiException messages for 401 and 403 say what to do and link to the token page and the plans,
  tagged utm_source=dotnet-sdk ... utm_content=error-401/error-403. Type, StatusCode and Response unchanged.
- Downloads (SaveFileAsync, SaveFilesAsync, FileStreamAsync) throw ConvertApiException unless the answer is
  200 OK, instead of saving the error page as the result.
- csproj: tags (common searches, the bare "to" with a comment, typos dropped), plain-ASCII description,
  PackageProjectUrl to the C# page, embedded 128x128 icon instead of PackageIconUrl (NU5048), and
  GenerateDocumentationFile with summaries on the main entry points.
- RELEASING.md: owner TODO, pre-release checklist and a release notes template. CHANGELOG and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release checklist points to a nonexistent package artifact instead of the workflow’s ConvertApi-<version> artifact.

1 open issue
What changed in this PR

This PR continues the 3.3.0 release work with clearer SDK errors, safer download handling, and improved NuGet packaging and documentation.

Changes:

  • Add actionable 401/403 messages and reject failed downloads before writing the destination file, with regression tests.
  • Update NuGet metadata, configure an embedded icon, and enable packaged XML documentation.
  • Expand error-handling documentation and add a release checklist and notes template.
File Description
RELEASING.md Add release ownership guidance, a checklist, and a notes template.
README.md Describe enhanced errors and failed-download exceptions.
ConvertApi/​Exceptions/​ConvertApiException.cs Add shared 401/403 guidance and exception documentation.
ConvertApi/​ConvertApiParam.cs Document file parameters and enhance upload errors.
ConvertApi/​ConvertApiExtension.cs Reject unsuccessful downloads and document helper exceptions.
ConvertApi/​ConvertApi.csproj Update package metadata, icon configuration, and XML documentation settings.
ConvertApi/​ConvertApi.cs Document conversion methods and enhance conversion/user errors.
ConvertApi.Tests/​ErrorTests.cs Test error guidance, response preservation, and download behavior.
CHANGELOG.md Record error-handling, packaging, and documentation changes.

Review effort: Balanced

Comment thread RELEASING.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the SDK error-handling, download, and packaging updates.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@tomasr78
tomasr78 merged commit 4d3cbb0 into main Nov 12, 2026
4 checks passed
@tomasr78
tomasr78 deleted the release-3.3.0-part-b branch November 12, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants